package com.frank.oj.service.entity.msg.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.frank.model.entity.msg.UserSysNotice;
import com.frank.oj.mapper.UserSysNoticeMapper;
import com.frank.oj.model.vo.SysMsgVO;
import com.frank.oj.service.entity.msg.UserSysNoticeEntityService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author frank
 * @Date 2024/1/25
 */
@Service
public class UserSysNoticeEntityServiceImpl extends ServiceImpl<UserSysNoticeMapper, UserSysNotice> implements UserSysNoticeEntityService {
    @Resource
    private UserSysNoticeMapper userSysNoticeMapper;
    @Override
    public IPage<SysMsgVO> getSysNotice(Integer limit, Integer currentPage, String uid) {
        Page<SysMsgVO> page = new Page<>(currentPage,limit);
        return userSysNoticeMapper.getSysOrMineNotice(page,uid,"Sys");
    }

    @Override
    public IPage<SysMsgVO> getMineNotice(Integer limit, Integer currentPage, String uid) {
        Page<SysMsgVO> page = new Page<>(currentPage,limit);
        return userSysNoticeMapper.getSysOrMineNotice(page,uid,"Mine");
    }
}
